﻿using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace _010_011_012操作符详解_6_delegate
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            //delegate声明匿名方法
            this.myButton.Click += delegate (object sender, RoutedEventArgs e)
        {
            this.myTextBox.Text = "Hello , World";
        };
            //两者意义上本质一样  但是下面的更适合现在开发
            //改写成+=表达式
            this.myButton.Click +=  (sender,e)=>
            {
                this.myTextBox.Text = "Hello  World";
            };
          
        }

    }
}